﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TheHeGeo.Master
{
    public partial class UcMenu : System.Web.UI.UserControl
    {
        public string Url { get; set; }
        public string MenuTxt { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            if(Url==null) return;
                var str = Url.Split('/');
                if (Url != null && TheHeGeo.Master.Site.GetCurrentFile().Equals(str[str.Length-1]))
                {
                    divContent.Attributes.Add("class", "menu-active");
                    
                }
                else
                {
                    divContent.Attributes.Add("class", "menu-inactive");
                }
                ltxt.Attributes.Add("onclick", "window.location.href='" + Url + "'");
                ltxt.InnerText = MenuTxt;
            //}
        }
    }
}